﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PJ.DBModel.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace PJ.DBModel.Mappings
{
    public class TaskscheduleMap : IEntityTypeConfiguration<Taskschedule>
    {
        public void Configure(EntityTypeBuilder<Taskschedule> builder)
        {
            builder.ToTable("taskschedule");

            builder.Property(e => e.CreateTime).HasComment("创建时间");

            builder.Property(e => e.CronExpress)
                .IsRequired()
                .HasMaxLength(255)
                .HasComment("Cron表达式");

            builder.Property(e => e.EndRunTime).HasComment("停止时间");

            builder.Property(e => e.FileName)
                .IsRequired()
                .HasMaxLength(255);

            builder.Property(e => e.JobGroup)
                .IsRequired()
                .HasMaxLength(255)
                .HasComment("任务组");

            builder.Property(e => e.JobName)
                .IsRequired()
                .HasMaxLength(255)
                .HasComment("任务名称");

            builder.Property(e => e.StarRunTime).HasComment("启动时间");

            builder.Property(e => e.State).HasComment("0停止,1启动,2假删除");
        }
    }
}
